home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
cgazv5n4.arc
/
WPPREFIX.H
< prev
next >
Wrap
C/C++ Source or Header
|
1991-09-23
|
2KB
|
58 lines
/*---- WPPREFIX.H ------------------------- Listing 1 -----
* The minimal prefix required for a WordPerfect file.
* All WordPerfect files use this prefix (except WP macro
* source code), even files which are not documents, such
* as dictionaries, thesauri, printer drivers, etc.
*
* by Andrew Binstock. See copyright terms in Lisitng 2.
*-------------------------------------------------------*/
#ifndef WPPREFIX_H /* no need to #include twice */
#define WPPREFIX_H 1
/* the following directives are to assure that
the prefix takes up exactly 16 bytes. You must
independently make sure that all values are stored
using the Intel byte-order (the default on PC's). */
#pragma pack(1) /* mandatory for Microsoft C */
typedef short WORD; /* make sure this is 16 bits */
typedef long DWORD; /* make sure this is 32 bits */
typedef signed char SCHAR; /* make sure of signed char */
struct wp_prefix
{
SCHAR id[4]; /* WP signature, must be: -1,W,P,C */
DWORD doc_start; /* offset to start of document. */
char prod_type; /* company product type:
1 = WordPerfect
9 = PlanPerfect
10 = DataPerfect
15 = DrawPerfect, etc. */
char file_type; /* = 0x0A */
char maj_version; /* major version = 0 */
char min_version; /* minor version :
1 = WP 5.1
0 = WP 5.0 */
WORD encrypted; /* encryption key:
0 = not encrypted */
WORD filler; /* reserved -- not used */
};
struct wp_addl_prefix /* 10 bytes */
{
WORD packet_type; /* Always = 0xFFFB */
WORD indices; /* Always 5 for WP 5.0, 5.1 */
WORD index_size; /* 10 * indices = 50 */
DWORD next_block;
};
struct wp_packet_index /* 10 bytes */
{
WORD type;
DWORD length;
DWORD data_offset;
};
#endif